package k8s

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"hera-admin/controller/response"
	"hera-admin/pkg/k8s/Init"
	"hera-admin/pkg/k8s/node"
)

func GetNodes(c *gin.Context) {
	fmt.Println("执行初始化ClusterID")
	client, err := Init.ClusterID(c)
	if err != nil {
		response.FailWithMessage(response.InternalServerError, err.Error(), c)
		return
	}
	fmt.Println("进入GetNodeList")
	data, err := node.GetNodeList(client, c)
	if err != nil {
		response.FailWithMessage(response.InternalServerError, err.Error(), c)
		return
	}
	response.OkWithData(data, c)
	return
}
